jQuery(document).ready(function( $ ) {
	$(".close_icon .cross_img").live("click",function(event){
		var confirmation = confirm("Are you sure ?");
		var tempTarget = event.target;
		var deleteLink = $(tempTarget).attr("alt");
		if(confirmation)
		{
			deleteImage(deleteLink);
			$('.img_wrapper[title='+deleteLink+']').fadeOut('slow');
		
		}
	});
	$(".prop_type_class").bind("change",function() {
		var prop_type = $(this).val();
		 changeProp(prop_type);
	});
	
	$(".stat_type_class").bind("change",function() {
		var stat_type = $(this).val();
		changeStat(stat_type);
	});
	
	$(".prop_imgs td img").not("td.item_img_large img").css("cursor","pointer");
	$(".prop_imgs td img").not("td.item_img_large img").bind("click",function(event) {
		var tempImage = event.target;
		var url = $(tempImage).attr("src");
		$("td.item_img_large img").attr("src",url);
	});
	
	
	$(".thumb_nails_img_item.latest img:first").attr("src",$(".latest_property_group img:first").attr("src"));
	$(".thumb_nails_img_item.latest img:first").attr("alt",$(".latest_property_group img:first").attr("alt"));
	
	$(".list1.main_page.latest_prop li a").bind("mouseover",function(event){
		var target = event.target;
		var id = $(target).attr("title");
		var getimgurl = $(".latest_property_group img[alt='"+id+"']").attr("src");
		$(".thumb_nails_img_item.latest img:first").attr("src",getimgurl);
		$(".thumb_nails_img_item.latest img:first").attr("alt",id);
	});
	
	$(".thumb_nails_img_item.recommend img:first").attr("src",$(".recommend_property_group img:first").attr("src"));
	$(".thumb_nails_img_item.recommend img:first").attr("alt",$(".recommend_property_group img:first").attr("alt"));
	
	$(".list1.main_page.recommend_prop li a").bind("mouseover",function(event){
		var target = event.target;
		var id = $(target).attr("title");
		var getimgurl = $(".recommend_property_group img[alt='"+id+"']").attr("src");
		$(".thumb_nails_img_item.recommend img:first").attr("src",getimgurl);
		$(".thumb_nails_img_item.recommend img:first").attr("alt",id);
	});
	
	$(".thumb_nails_img_item.profile img:first").attr("src",$(".property_by_user_group img:first").attr("src"));
	$(".thumb_nails_img_item.profile img:first").attr("alt",$(".property_by_user_group img:first").attr("alt"));
	
	$(".list1.main_page.profile li a").bind("mouseover",function(event){
		var target = event.target;
		var id = $(target).attr("title");
		var getimgurl = $(".property_by_user_group img[alt='"+id+"']").attr("src");
		$(".thumb_nails_img_item.profile img:first").attr("src",getimgurl);
		$(".thumb_nails_img_item.profile img:first").attr("alt",id);
	});
});
